package com.joey.jvm.example.memory;

/**
 * -verbose:gc -XX:+PrintGCDetails -XX:+UseSerialGC -Xms200M -Xmx200M -Xmn10M -XX:SurvivorRatio=8
 * def new generation 位Serial垃圾回收器
 * PSYoungGen 则用的是Parallel Scavenge
 * @author hyy
 * @description
 * @date 2019-03-29 15:46
 **/
public class MemoryAllocationExample {

    public static void main(String[] args) {
        //[GC (Allocation Failure) [DefNew: 2682K->828K(9216K), 0.0038426 secs] 2682K->828K(203776K), 0.0039142 secs]
        // [Times: user=0.00 sys=0.00, real=0.00 secs]
        byte []z = new byte[6 * 1024 * 1024];
        byte []y = new byte[30 * 1024 * 1024];
        byte []x = new byte[100 * 1024 * 1024];

        //[Full GC (System.gc()) [Tenured: 133120K->140008K(194560K), 0.0130317 secs] 140092K->140008K(203776K),
        //[Metaspace: 3490K->3490K(1056768K)], 0.0130936 secs] [Times: user=0.00 sys=0.02, real=0.01 secs]
        System.gc();
    }

}




    